import sys, socket

def gethostbyip(addr):
    return socket.gethostbyaddr(addr)[0]

def getipbyname(name):
    result = socket.getaddrinfo(name,None,0,socket.SOCK_STREAM)
    return [ x[4][0] for x in result]

hostname = gethostbyip(sys.argv[1])
iplist = getipbyname(hostname)

statue = False
for item in iplist:
	if sys.argv[1] != item:
		pass
	else:
		statue = True
if statue:
	print "this look up is success!\n"*2
	print "host name is > ",hostname
	for item in iplist:
		if '::' in item:
			print "this is Ipv6 : ",item
		else :
			print "this is ipv4 : ",item
else :
	print "fool ip"

